import i18n from '@/i18n';
import Layout from '@/layout/menuLayout.vue';
import type { RouteRecordRaw } from 'vue-router';

const { t } = i18n.global;

const menuRouter: RouteRecordRaw = {
	path: '/menu',
	component: Layout,
	redirect: '/menu/overView',
	meta: { roles: ['overView', 'monitor', 'topo', 'warning', 'report', 'iv'] },
	children: [
		{
			path: 'overView',
			name: 'overView',
			component: () => import('@/views/menu/overView/index.vue'), // 数据总览
			meta: {
				title: t('menu.overView'),
				icon: 'overView',
				roles: ['overView'],
				show: true,
				menu: 'overView',
			},
		},
		{
			path: 'report',
			name: 'report',
			component: () => import('@/views/menu/report/index.vue'), // 报表统计
			meta: {
				title: t('menu.report'),
				icon: 'report',
				roles: ['report'],
				show: true,
				menu: 'report',
			},
		},
	],
};

export default menuRouter;
